﻿using Simple.Common.Helpers;
using System;

namespace Simple.Services;

/// <summary>
/// 学生
/// </summary>
public class UserModel : ModelBase
{
    public string Id { get; set; }
    //？？姓名
    public string Name { get; set; }
    //
    public string UserName { get; set; }
    public string Password { get; set; }
    public string? Phone { get; set; }
    public string? Email { get; set; }
    public GenderType Gender { get; set; }
    public bool IsEnabled { get; set; }

    public string? PositionId { get; set; }
    public string? OrganizationId { get; set; }
    public string? CreatedUserId { get; set; }
    public string? UpdatedUserId { get; set; }

    public AdminType AdminType { get; set; }
    public long RowVersion { get; set; }
    public bool IsDeleted { get; set; }
    public DateTime? CreatedTime { get; set; }
    public DateTime? UpdatedTime { get; set; }

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<SysUser, UserModel>()
            .ForMember(d => d.Id, options => options.MapFrom(s => s.Id))
            .ForMember(d => d.Name, options => options.MapFrom(s => s.Name));

        profile.CreateMap<UserModel, SysUser>()
            .ForMember(d => d.Id, options => options.MapFrom(s => s.Id))
            .ForMember(d => d.Name, options => options.MapFrom(s => s.Name));
    }
}

